﻿using System;
using System.Collections.Generic;

using Aden.Model;
using Aden.Model.Stock;
using Aden.DAL.StockData;


namespace Aden.BLL.StockData
{
    public class StockTransHelper
    {
        private static StockTransFactory factory = null;
        public static StockTransHelper instatnce(StockParam param)
        {
            try
            {
                factory = new StockTransFactory(param.appGuid, param.costCenterCode, param.date, param.creater);

                return new StockTransHelper();
            }
            catch(Exception e)
            {
                throw e;
            }
        }
        public List<Dictionary<string,object>> GetItems(StockParam param)
        {
            try
            {
                return factory.GetItems(param);
            }
            catch (Exception e)
            {
                throw e;
            }

        }

        public List<Dictionary<string, object>> GetDates()
        {
            try
            {
                return factory.GetDates();
            }
            catch (Exception e)
            {
                throw e;
            }

        }

        public Dictionary<string,object> save(StockParam param)
        {
            try
            {                
                return factory.save(param);
            }
            catch (Exception e)
            {
                throw e;
            }

        }

        public Dictionary<string, object> ShowComponents()
        {
            try
            {
                return factory.ShowComponents();
            }
            catch (Exception e)
            {
                throw e;
            }

        }

        /*
         List<TransData> list = new List<TransData>();
                list.Add(new TransData()
                {
                    itemCode = "101170",
                    itemName = "100209",
                    itemPrice = 150,
                    stockQty = 100,
                    qty = 3,
                    toCostCenterCode = "270ZZZ01"
                });

                list.Add(new TransData()
                {
                    itemCode = "103054",
                    itemName = "100210",
                    stockQty = 200,
                    qty = 400,
                    toCostCenterCode = "270ZZZ012"
                });

                list.Add(new TransData()
                {
                    itemCode = "103312",
                    itemName = "100210",
                    stockQty = 200,
                    qty = 150,
                    toCostCenterCode = "270ZZZ012"
                });
                list.Add(new TransData()
                {
                    itemCode = "1030",
                    itemName = "100210",
                    isServiceItem = true,
                    itemCost = 20,
                    stockQty = 200,
                    qty = 400,
                    toCostCenterCode = "270ZZZ012"
                });
                */
    }
}
 